<?php ob_start(); ?>
<!DOCTYPE html>
<html>
<?php 
	$root = $_SERVER['DOCUMENT_ROOT'];
 	include($root.'/standart/head.php');
 	include($root.'/standart/dateHeader.php');
 	include($root.'/standart/checkUser.php');
?>
<?php
	$db = connect();
	$adminId = $_COOKIE["GEVEZE_ADMIN"];
	if(isset($_COOKIE["GEVEZE_ADMIN"])){
		$stmt ="SELECT *
		FROM ADMIN
		WHERE ID = $adminId";
		$res = $db->query($stmt) or die($stmt."<br/><br/>".mysql_error());
		if($row = $res->fetch_assoc()){
			$adminId = $row['NAME'].' '.$row['SURNAME'];
		}
		$res->close();
	}
	disconnect($db);
?>
<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Çözüm Dükkanı Admin Panel</title>

    <!-- Core CSS - Include with every page -->
    <link href="css/bootstrap.min.css" rel="stylesheet">
    <link href="font-awesome/css/font-awesome.css" rel="stylesheet">

    <!-- Page-Level Plugin CSS - Dashboard -->
    <link href="css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
    <link href="css/plugins/timeline/timeline.css" rel="stylesheet">

    <!-- SB Admin CSS - Include with every page -->
    <link href="css/sb-admin.css" rel="stylesheet">
</head>

<body style="padding-top:50px !important;">

    <div id="wrapper">

        <nav class="navbar navbar-default navbar-fixed-top" role="navigation" style="margin-bottom: 0">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-collapse">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">Çözüm Dükkanı Admin Panel</a>
            </div>
            <!-- /.navbar-header -->

            <ul class="nav navbar-top-links navbar-right">
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a href="#">
                        <b>Hoşgeldiniz <?php echo $adminId?></b>
                    </a>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
                <li class="dropdown">
                    <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                        <i class="fa fa-user fa-fw"></i>  <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li onclick="document.getElementById('container').src = 'settings/settings.php?rnd='+Math.random()">
                        <a  href="#"><i class="fa fa-gear fa-fw"></i> Settings</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="login/logout.php"><i class="fa fa-sign-out fa-fw"></i> Logout</a>
                        </li>
                    </ul>
                    <!-- /.dropdown-user -->
                </li>
                <!-- /.dropdown -->
            </ul>
            <!-- /.navbar-top-links -->
            <div class="navbar-default navbar-static-side" role="navigation">
                <div class="sidebar-collapse">
                    <ul class="nav" id="side-menu">
						<!-- 
						<li class="sidebar-search">
                            <div class="input-group custom-search-form">
                                <input type="text" class="form-control" placeholder="Search...">
                                <span class="input-group-btn">
                                <button class="btn btn-default" type="button">
                                    <i class="fa fa-search"></i>
                                </button>
                            </span>
                            </div>
                            
                        </li>
                         -->
						<li onclick="document.getElementById('container').src = 'blank2.html'">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Anasayfa</a>
						</li>
						<li>
							<a href="onlineOrder" target="_blank"><i class="fa fa-hand-o-right fa-fw"></i> Online Sipariş Al</a>
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'category'">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Menü</a>
						</li>
						<li>
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Ürünler<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level">
                                <li onclick="loadPageX(); document.getElementById('container').src = 'product/index.php?rnd='+Math.random()">
									<a href="#">Ürün Bilgileri</a>
								</li>
								<li onclick="loadPageX(); document.getElementById('container').src = 'productInfo/index.php?rnd='+Math.random()">
									<a href="#">Ürün Özellikleri</a>
								</li>
								<li onclick="loadPageX(); document.getElementById('container').src = 'tabldot/index.php?rnd='+Math.random()">
									<a href="#">Tabldot</a>
								</li>
                            </ul>
                            <!-- /.nav-second-level -->
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'event'">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Etkinlikler</a>
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'users/userMainPage.php?rnd='+Math.random()">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Kullanıcılar</a>
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'webContent/addContent.php?rnd='+Math.random()">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Web Sayfası Ayarları</a>
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'inventory/index.php?rnd='+Math.random();">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Malzeme Girişi</a>
						</li>
						<li onclick="loadPageX(); document.getElementById('container').src = 'ordersMenu/orders.php?rnd='+Math.random()">
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Güncel Sipariş Listesi</a>
						</li>
						<li>
							<a href="#"><i class="fa fa-hand-o-right fa-fw"></i> Raporlar<span class="fa arrow"></span></a>
							<ul class="nav nav-second-level">
                                <li onclick="loadPageX(); document.getElementById('container').src = 'inventory/inventoryReport.php?rnd='+Math.random()">
                                    <a href="#">Ürün Giriş Raporu</a>
                                </li>
                                <li onclick="loadPageX(); document.getElementById('container').src = 'orders/ordersReport.php?rnd='+Math.random()">
                                    <a href="#">Sipariş Raporu</a>
                                </li>
                            </ul>
                            <!-- /.nav-second-level -->
						</li>
					</ul>
                    <!-- /#side-menu -->
                </div>
                <!-- /.sidebar-collapse -->
            </div>
            <!-- /.navbar-static-side -->
        </nav>

        <div id="page-wrapper">
            <iframe frameborder="0" class="frame" src="blank2.html" id="container"></iframe>
        </div>
        <!-- /#page-wrapper -->

    </div>
    <div class="modal"><!-- Place at bottom of page --></div>
    <!-- /#wrapper -->

    <!-- Core Scripts - Include with every page -->
    <script src="js/jquery-1.10.2.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script>

    <!-- Page-Level Plugin Scripts - Dashboard -->
    <script src="js/plugins/morris/raphael-2.1.0.min.js"></script>
    <script src="js/plugins/morris/morris.js"></script>

    <!-- SB Admin Scripts - Include with every page -->
    <script src="js/sb-admin.js"></script>
    <script src="js/jquery.plainoverlay.min.js"></script>

    <!-- Page-Level Demo Scripts - Dashboard - Use for reference -->
    <script src="js/demo/dashboard-demo.js"></script>
    <script type="text/javascript">
		function loadPageX(){
			$('body').plainOverlay('show');
		}

		function unloadPageX(){
			$('body').plainOverlay('hide');
		}
    </script>
</body>

</html>
